<?php echo $this->fetch('header.html'); ?>
 
 <ul class="nav nav-tabs">
 	<li class="active"><a href="<?php echo $this->_var['appadmin']; ?>?m=koudai_product">产品管理</a></li>
   
 </ul>
<div class="main-body">
 
 <div class="plist">
  <?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
  <div class="item">
   
    
    	<div class="g-sd1">
        	<img src="<?php echo images_site($this->_var['c']['imgurl']); ?>.100x100.jpg">
        </div>
        <div class="g-mn1">
        	<div class="g-mn1c">
            	 <div class="title"><?php echo $this->_var['c']['title']; ?></div>
            	<div class="row-price">
               	 <span>价格￥<span id="price<?php echo $this->_var['c']['id']; ?>"><?php echo $this->_var['c']['price']; ?></span> <span>
                 <span><?php if ($this->_var['c']['lower_price'] > 0): ?>促销价：￥<?php echo $this->_var['c']['lower_price']; ?>元<?php endif; ?></span>
                 <span>官方价：<?php echo $this->_var['c']['p_price']; ?></span>
                 <span>库存：<?php echo $this->_var['c']['total_num']; ?></span>
                 <span>销量：<?php echo $this->_var['c']['buy_num']; ?></span>
                </div>
                <div class="tools"> <a href="javascript:;" url="<?php echo $this->_var['appadmin']; ?>?m=koudai_product" did="<?php echo $this->_var['c']['id']; ?>" class="chprice">修改售价</a> </div>

            </div>
        </div>
   
    
    
  </div>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  </div>
  <?php if ($this->_var['pagelist']): ?>
  <div><?php echo $this->_var['pagelist']; ?></div>
    <?php endif; ?>
 

</div>
 

<?php echo $this->fetch('footer.html'); ?>
<script>
 
$(function(){
	$(document).on("click",".chprice",function(data){
		var html='<div class="pd-5"><input type="text" style="width:60px" id="kd_price"> <button class="btn" id="kd_price_submit" did="'+$(this).attr("did")+'">修改</button><div>';
		showbox("修改价格",html,200,100); 
	});
	
	$(document).on("click","#kd_price_submit",function(data){
		var obj=$(this);
		$.get("<?php echo $this->_var['appadmin']; ?>?m=koudai_product&a=chprice&ajax=1",{
				id:$(this).attr("did"),
				price:$("#kd_price").val()
			},function(data){
				if(data.error){
					skyToast(data.message);
				}else{
					$("#price"+obj.attr("did")).html($("#kd_price").val());
				}
		},"json");
	});
	 
});
</script>
</div>
</body>
</html>